/*
 * $ .\gflagsDemo.exe --verbose --userName=靓仔
 * $ .\gflagsDemo.exe --verbose=true --userName=靓仔
 * gflagsDemo.cpp:[021] --- verbose true.
 * gflagsDemo.cpp:[022] --- userName 靓仔.
 * gflagsDemo.cpp:[023] --- userName size 4.
 */
#include <iostream>
#include <gflags/gflags.h>
#include "../log/log.h"

DEFINE_bool     (verbose, false, "冗长打印");
DEFINE_string   (userName, "Nnnnut", "用户名");

int main(int argc, char* argv[])
{
    gflags::SetUsageMessage("这是一个gflags的Demo。");
    gflags::SetVersionString("0.0.1");
    gflags::ParseCommandLineFlags(&argc, &argv, true);
    if (FLAGS_verbose) {
        LOG("verbose true.");
        LOG("userName %s.",        FLAGS_userName.c_str());
        LOG("userName size %d.",   FLAGS_userName.size());
    }
    else {
        LOG("verbose false.");
    }
    return 0;
}